//
//  BackgroundColor.m
//  AirTrafficControl
//
//  Created by gu steve on 1/9/12.
//  Copyright (c) 2012 SteveGu. All rights reserved.
//

#import "BackgroundColorLayer.h"

@implementation BackgroundColorLayer

-(id) init
{
    if (self = [super initWithColor:ccc4(0,0,0,255)]) {
        
    }
    
    return self;
}

-(void)draw{
    glColor4ub(50, 70, 0, 255);
    glLineWidth(2.0f);
    glEnable(GL_LINE_SMOOTH);
    
    CCDirector *director = [CCDirector sharedDirector];
    CGSize size = [director winSize];
    
    int sum = size.width / 128;
    
    for (int i = 0; i< sum; i++) {
        ccDrawLine(ccp(i*128,0), ccp(i*128,size.height));
    }
    
    sum = size.height / 128;
    
    for (int i = 0; i< sum; i++) {
        ccDrawLine(ccp(0,i*128), ccp(size.width,i*128));
    }
}

-(void) dealloc
{
    [super dealloc];
}

@end
